//
//  ScanViewController.m
//  Scanner
//
//  Created by 米明 on 15/5/14.
//  Copyright (c) 2015年 米明. All rights reserved.
//

#import "ScanViewController.h"
#import "GoodDetailViewController.h"
#import "CustomViewController.h"
#import "SDImageCache.h"

@interface ScanViewController ()

@property (weak, nonatomic) IBOutlet UITextField *barcodeTextField;
@property (weak, nonatomic) IBOutlet UILabel *leftTitleLable;
@property (weak, nonatomic) IBOutlet UIButton *searchButton;

@end

@implementation ScanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self creatLeftBtnItemWithTitle:@"清除缓存"];
    // Do any additional setup after loading the view.
}
-(void)leftBarBtnItem{
   
    [[SDImageCache sharedImageCache]clearDisk];
    [[SDImageCache sharedImageCache]cleanDisk];
    [self showInfo:@"已清除"];
}


#pragma mark - 查询商品
- (IBAction)searchGood:(id)sender {
    
    [self.barcodeTextField resignFirstResponder];
    //self.barcodeTextField.text=@"6902538006100";
    if (self.barcodeTextField.text.length>0) {
      
        GoodDetailViewController *good =[ [GoodDetailViewController alloc]init];
        good.goodCode=self.barcodeTextField.text;
        good.hidesBottomBarWhenPushed=YES;
        [self.navigationController pushViewController:good animated:YES];
    }else{
        [self showInfo:@"输入为空"];
    }

}

- (IBAction)tapTheView:(id)sender {
    [self.barcodeTextField resignFirstResponder];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
